// import 'reflect-metadata'
import path from 'node:path'
import { DataSource } from 'typeorm'



export const AppDataSource = new DataSource({
    type: "sqlite",
    database: "database.sqlite",
    synchronize: true,
    // logging: ["query", "error"],
    "entities": [`../entity/**/*.js`],
    migrations: [`../migration/**/*.js`],
    subscribers: [],
})


// const dbpath=path.dirname(import.meta.dirname)

// export default new DataSource({
//     type: "sqlite",
//     database: "database.sqlite",
//     synchronize: true,
//     logging: false,
//     "entities": [`${dbpath}/entity/**/*.js`],
//     migrations: [`${dbpath}/migration/**/*.js`],
//     subscribers: [],
// })
// export default AppDataSource